# hoverMenu Function
hoverMenu = (parent, target, tabcontent) ->
    $(target).click ->
        $(".index-menu-area").fadeOut()
        $(".index-notify-icon, .index-avatar-small").css 'background','#1ab7f2'

        $(tabcontent).toggle()

        if ($(tabcontent).is ':hidden')
            $(target).css background: '#1ab7f2'
        else
            $(target).css background: '#17a4d9'

        return
    return

# Connection Menu
hoverMenu(".index-notice-connection", ".index-notice-connection", ".index-area-connection")

# Message Menu
hoverMenu(".index-notice-message", ".index-notice-message", ".index-area-message")

# Status Menu
hoverMenu(".index-notice-status", ".index-notice-status", ".index-area-status")

# Option Menu
hoverMenu(".index-option-setting", ".index-option-setting", ".index-area-setting")


$(".index-area-setting li").click ->
    href = $(this).find('a').attr 'href'
    window.location.href = href
    return

#17a4d9
$(".index-notify-icon, .index-account-avatar").hover ->
    unless $(this).css('background-color') is 'rgb(23, 164, 217)'
        $(this).css 'background', '#30bef3'
    return
, ->
    unless $(this).css('background-color') is 'rgb(23, 164, 217)'
        $(this).css 'background', '#1ab7f2'
    return